<?php
defined( '_JEXEC' ) or die( 'Restriced access' );
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language;?>" lang="<?php echo $this->language; ?>" >

<head>
	<title>BookPeople</title>

	<jdoc:include type="head" />
    <?php
		if( isset( $_COOKIE["users_resolution"] ) && isset( $_COOKIE["users_width"] ) )
		{
			$res = $_COOKIE["users_resolution"];
			$width = $_COOKIE["users_width"];
			$width = (integer) $width;
			if( $width <= "800" )
				echo '<link rel = "stylesheet" type = "text/css" 
					   href = "templates/'.$this->template.'/css/fluidstyle800.css" media = "all" />';
			elseif( $width == "1024" )
				echo '<link rel = "stylesheet" type = "text/css" 
					   href = "templates/'.$this->template.'/css/fluidstyle1024.css" media = "all" />';
			else
				echo '<link rel = "stylesheet" type = "text/css" 
					   href = "templates/'.$this->template.'/css/fluidstyle.css" media = "all" />';
		}
		else
		{
	?>
   		<script language = "Javascript">
			<!--
				writeCookie();
				
				function writeCookie()
				{
					var the_date = new Date();
					the_date.setDate( the_date.getDate() + 5 );
					var cookie_date = the_date.toGMTString();
					var the_cookie = "users_resolution=" + screen.width + "x" + screen.height;
					var the_cookie = the_cookie + ";expires=" + cookie_date;
					var the_cookie_width = "users_width=" + screen.width;
					var the_cookie_width = the_cookie_width + ";expires=" + cookie_date;
					document.cookie = the_cookie;
					document.cookie = the_cookie_width;
					location = '/index.php';
				}
			-->
			</script>
    <?php
		}
	?>
    
    <?php
		// Browser sniff for IE
		if( $width != "800" && $width != "1024" )
		{
			// && eregi( "[7]\.[0]", $ua_ok ) <-- code taken out of the if statement
			$ua_ok = $_SERVER['HTTP_USER_AGENT'];
			if( eregi( "Windows", $ua_ok ) && eregi( "msie", $ua_ok ) )
				echo '<link rel = "stylesheet" type = "text/css" 
					   href = "templates/'.$this->template.'/css/fluidstyleie.css" media = "all" />';
		}
	?>

</head>

<body>
	
    <div id = "header">
    	<p id = "support"><a href = "http://www.bookpeople.com/services.html">Need help?</a></p>
    	<a href = "http://www.bookpeople.com">
        	<img src = "templates/<?php echo $this->template; ?>/images/bpheaderweb.png" alt = "BookPeople logo" /></a>
        <ul id = "main_menu">
        	<li><a href = "http://www.bookpeople.com/">Home</a></li>
            <li><a href = "http://www.bookpeople.com/bookkids.html">BookKids</a></li>
            <li><a href = "http://www.bookpeople.com/calendar_of_events.php">Events</a></li>
            <li><a href = "http://www.bookpeople.com/gifts.html">Gifts</a></li>
            <li class = "right"><a href = "http://www.bookpeople.com/camps.html">Camps</a></li>
        </ul>
        
    </div>
    
    <div class = "clear"></div>
    
	<div id = "box">
    	
        <div id = "left_wrap">
        	<h6 class = "left_caption"><span>Announcements &amp; News</span></h6>
        	<div id = "left_bar_announce">
            	<jdoc:include type="modules" name="left1" style="xhtml" />
        	</div>
            
            <h6 class = "left_caption"><span>BookPeople Recommends</span></h6>
            <div id = "left_bar_recommends">
            	<jdoc:include type="modules" name="left2" style="xhtml" />
            </div>
        </div>
        
        <?php if( $option != "com_content" ) : ?>
        	<h6 class = "caption_right"><span>Coming Up</span></h6>
        	<div>
        		<jdoc:include type="component" />
            </div>
        <?php endif; ?>
        
        <?php if( $this->countModules( 'main' ) ) : ?>
        <h6 class = "caption_right"><span>Coming Up</span></h6>
        <div id = "coming_up">
        	<jdoc:include type="modules" name="main" style="xhtml" />
        </div>
        <?php endif; ?>
        
        <?php if( $this->countModules( 'mainbl' ) ) : ?>
        <div id = "blog_wrap">
            <h6 class = "caption_right_float"><span>BookPeople Blog</span></h6>
            <div id = "blog">
            	<jdoc:include type="modules" name="mainbl" style="xhtml" />
            </div>    
        </div>
        <?php endif; ?>


		<?php if( $this->countModules( 'mainbr' ) ) : ?>
        <h6 class = "caption_right"><span>BookPeople in the Community</span></h6>        
        <div id = "community">
			<jdoc:include type="modules" name ="mainbr" style="xhtml" />
            <!--<ul>
                <li>Blanton Museum</li>
                <li>Insite Books Project</li>
                <li>Shoal Creek Cleanup</li>
                <li>Book Fairs</li>
                <li>Literary Camps</li>
                <li>Shopping Nights</li>
            </ul>-->        
        </div>
        <?php endif; ?>
        
        <!--<div id = "component">
        	<jdoc:include type="component" />
        </div>-->

        <div class = "clear"></div>
        
    </div>
    
    <div id = "footer">
    	<p>
      		<a href = "http://www.bookpeople.com">Home</a>&nbsp;&nbsp;|&nbsp;&nbsp; 
            <a href = "http://www.bookpeople.com/bookkids.html">BookKids</a>&nbsp;&nbsp;|&nbsp;&nbsp;
            <a href = "http://www.bookpeople.com/events.html">Events</a>&nbsp;&nbsp;|&nbsp;&nbsp; 
            <a href = "http://www.bookpeople.com/gifts.html">Gifts</a>&nbsp;&nbsp;|&nbsp;&nbsp; 
            <a href = "http://www.bookpeople.com/camps.html">Camps</a>&nbsp;&nbsp;|&nbsp;&nbsp; 
            <a href = "http://www.bookpeople.com/services.html">Support</a><br />
            &copy; 2008 BookPeople
        </p>
    </div>

</body>
</html>